/*
wgtsettings.h
(c) 2010 Yury Hamenkov
This file is part of qWordCards.

qWordCards is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

qWordCards is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with qWordCards. If not, see <http://www.gnu.org/licenses/>.
*/

#ifndef WGTSETTINGS_H
#define WGTSETTINGS_H

#include <QDialog>
#include <QWidget>
#include <QSpinBox>
#include <QLabel>
#include <QLineEdit>
#include <QCheckBox>
#include <QColorDialog>
#include <QTabWidget>
#include <QPushButton>
#include <QFontDialog>
#include <QComboBox>
#include <QFrame>

namespace qWordCards {
	class WGTSettings : public QDialog {
	Q_OBJECT

	private:
		QFontDialog*		FDLFontDialog;
		QColorDialog*		CDLColorDialog;

		QTabWidget*			TWGTabs;
		QWidget*			WGTBehaviour;
		QWidget*			WGTAppearance;

		QWidget*			WGTBottomPanel;
		QPushButton*		BTNSaveButton;
		QPushButton*		BTNCloseButton;

		// Behaviour tab
		QLabel*				LBLWordChangeInterval;
		QSpinBox*			SBXWordChangeInterval;

		QCheckBox*			CHXWordShowDuration;
		QSpinBox*			SBXWordShowDuration;

		QCheckBox*			CHXTranslationShowInterval;
		QSpinBox*			SBXTranslationShowInterval;


		// Appearance tab
		QCheckBox*			CHXShowToolbar;

		QLabel*				LBLLanguage;
		QComboBox*			CBXLanguage;

		QFrame*				FRMMainWindowBackColor;
		QLabel*				LBLMainWindowBackColorLabel;
		QPushButton*		BTNChooseMainWindowBackColor;

		QLabel*				LBLWordFont;
		QLabel*				LBLWordFontExample;
		QPushButton*		BTNWordFont;
		QPushButton*		BTNWordColor;

		QLabel*				LBLTranscriptionFont;
		QLabel*				LBLTranscriptionFontExample;
		QPushButton*		BTNTranscriptionFont;
		QPushButton*		BTNTranscriptionColor;

		QLabel*				LBLTranslationFont;
		QLabel*				LBLTranslationFontExample;
		QPushButton*		BTNTranslationFont;
		QPushButton*		BTNTranslationColor;

		QFont				FNTWordFont;
		QFont				FNTTranscriptionFont;
		QFont				FNTTranslationFont;

		QColor				CLRWordColor;
		QColor				CLRTranscriptionColor;
		QColor				CLRTranslationColor;
		
		QColor				CLRMainWindowBackColor;


		void UpdateWordExamples();

	public:
		explicit WGTSettings(QWidget *parent = 0);

	signals:
		void sg_ShowToolbarValueChanged();


	public slots:
	private slots:
		void sl_BTNWordFontClicked();
		void sl_BTNTranscriptionFontClicked();
		void sl_BTNTranslationFontClicked();

		void sl_BTNWordColorClicked();
		void sl_BTNTranscriptionColorClicked();
		void sl_BTNTranslationColorClicked();
		
		void sl_BTNChooseMainWindowBackColorClicked();

		void sl_CHXWordShowDurationStateChanged(int i);
		void sl_CHXTranslationShowIntervalStateChanged(int i);

		void sl_SBXWordChangeIntervalValueChanged(int i);
		void sl_SBXWordShowDurationValueChanged(int i);
		void sl_SBXTranslationShowIntervalValueChanged(int i);

		void sl_BTNSaveClicked();
		void sl_BTNCloseClicked();

	};
}
#endif // WGTSETTINGS_H
